<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/date_time/gregorian/greg_month.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/date_time/gregorian</a> - greg_month.hpp<span style="font-size: 80%;"> (source / <a href="greg_month.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">3</td>
            <td class="headerCovTableEntryLo">33.3 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">3</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #ifndef GREG_MONTH_HPP___</a>
<span class="lineNum">       2 </span>            : #define GREG_MONTH_HPP___
<span class="lineNum">       3 </span>            : 
<span class="lineNum">       4 </span>            : /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
<span class="lineNum">       5 </span>            :  * Use, modification and distribution is subject to the 
<span class="lineNum">       6 </span>            :  * Boost Software License, Version 1.0. (See accompanying
<span class="lineNum">       7 </span>            :  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       8 </span>            :  * Author: Jeff Garland, Bart Garst
<span class="lineNum">       9 </span>            :  * $Date$
<span class="lineNum">      10 </span>            :  */
<span class="lineNum">      11 </span>            : 
<span class="lineNum">      12 </span>            : #include &quot;boost/date_time/constrained_value.hpp&quot;
<span class="lineNum">      13 </span>            : #include &quot;boost/date_time/date_defs.hpp&quot;
<span class="lineNum">      14 </span>            : #include &quot;boost/shared_ptr.hpp&quot;
<span class="lineNum">      15 </span>            : #include &quot;boost/date_time/compiler_config.hpp&quot;
<span class="lineNum">      16 </span>            : #include &lt;stdexcept&gt;
<span class="lineNum">      17 </span>            : #include &lt;string&gt;
<span class="lineNum">      18 </span>            : #include &lt;map&gt;
<span class="lineNum">      19 </span>            : #include &lt;algorithm&gt;
<span class="lineNum">      20 </span>            : #include &lt;cctype&gt;
<span class="lineNum">      21 </span>            : 
<span class="lineNum">      22 </span>            : namespace boost {
<span class="lineNum">      23 </span>            : namespace gregorian {
<span class="lineNum">      24 </span>            : 
<span class="lineNum">      25 </span>            :   typedef date_time::months_of_year months_of_year;
<span class="lineNum">      26 </span>            : 
<span class="lineNum">      27 </span>            :   //bring enum values into the namespace
<span class="lineNum">      28 </span>            :   using date_time::Jan;
<span class="lineNum">      29 </span>            :   using date_time::Feb;
<span class="lineNum">      30 </span>            :   using date_time::Mar;
<span class="lineNum">      31 </span>            :   using date_time::Apr;
<span class="lineNum">      32 </span>            :   using date_time::May;
<span class="lineNum">      33 </span>            :   using date_time::Jun;
<span class="lineNum">      34 </span>            :   using date_time::Jul;
<span class="lineNum">      35 </span>            :   using date_time::Aug;
<span class="lineNum">      36 </span>            :   using date_time::Sep;
<span class="lineNum">      37 </span>            :   using date_time::Oct;
<span class="lineNum">      38 </span>            :   using date_time::Nov;
<span class="lineNum">      39 </span>            :   using date_time::Dec;
<span class="lineNum">      40 </span>            :   using date_time::NotAMonth;
<span class="lineNum">      41 </span>            :   using date_time::NumMonths;
<a name="42"><span class="lineNum">      42 </span>            :   </a>
<span class="lineNum">      43 </span>            :   //! Exception thrown if a greg_month is constructed with a value out of range
<a name="44"><span class="lineNum">      44 </span><span class="lineNoCov">          0 :   struct bad_month : public std::out_of_range</span></a>
<span class="lineNum">      45 </span>            :   {
<span class="lineNum">      46 </span><span class="lineNoCov">          0 :     bad_month() : std::out_of_range(std::string(&quot;Month number is out of range 1..12&quot;)) {}</span>
<span class="lineNum">      47 </span>            :   };
<span class="lineNum">      48 </span>            :   //! Build a policy class for the greg_month_rep
<span class="lineNum">      49 </span>            :   typedef CV::simple_exception_policy&lt;unsigned short, 1, 12, bad_month&gt; greg_month_policies;
<span class="lineNum">      50 </span>            :   //! A constrained range that implements the gregorian_month rules
<span class="lineNum">      51 </span>            :   typedef CV::constrained_value&lt;greg_month_policies&gt; greg_month_rep;
<span class="lineNum">      52 </span>            : 
<span class="lineNum">      53 </span>            :   
<span class="lineNum">      54 </span>            :   //! Wrapper class to represent months in gregorian based calendar
<span class="lineNum">      55 </span>            :   class BOOST_DATE_TIME_DECL greg_month : public greg_month_rep {
<span class="lineNum">      56 </span>            :   public:
<span class="lineNum">      57 </span>            :     typedef date_time::months_of_year month_enum;
<span class="lineNum">      58 </span>            :     typedef std::map&lt;std::string, unsigned short&gt; month_map_type;
<span class="lineNum">      59 </span>            :     typedef boost::shared_ptr&lt;month_map_type&gt; month_map_ptr_type;
<span class="lineNum">      60 </span>            :     //! Construct a month from the months_of_year enumeration
<span class="lineNum">      61 </span>            :     greg_month(month_enum theMonth) : 
<span class="lineNum">      62 </span>            :       greg_month_rep(static_cast&lt;greg_month_rep::value_type&gt;(theMonth)) {}
<span class="lineNum">      63 </span>            :     //! Construct from a short value
<span class="lineNum">      64 </span>            :     greg_month(unsigned short theMonth) : greg_month_rep(theMonth) {}
<span class="lineNum">      65 </span>            :     //! Convert the value back to a short
<span class="lineNum">      66 </span><span class="lineCov">      82812 :     operator unsigned short()  const {return value_;}</span>
<span class="lineNum">      67 </span>            :     //! Returns month as number from 1 to 12
<span class="lineNum">      68 </span>            :     unsigned short as_number() const {return value_;}
<span class="lineNum">      69 </span>            :     month_enum as_enum() const {return static_cast&lt;month_enum&gt;(value_);}
<span class="lineNum">      70 </span>            :     const char* as_short_string() const;
<span class="lineNum">      71 </span>            :     const char* as_long_string()  const;
<span class="lineNum">      72 </span>            : #ifndef BOOST_NO_STD_WSTRING
<span class="lineNum">      73 </span>            :     const wchar_t* as_short_wstring() const;
<span class="lineNum">      74 </span>            :     const wchar_t* as_long_wstring()  const;
<span class="lineNum">      75 </span>            : #endif // BOOST_NO_STD_WSTRING
<span class="lineNum">      76 </span>            :     //! Shared pointer to a map of Month strings (Names &amp; Abbrev) &amp; numbers
<span class="lineNum">      77 </span>            :     static month_map_ptr_type get_month_map_ptr();
<span class="lineNum">      78 </span>            : 
<span class="lineNum">      79 </span>            :     /* parameterized as_*_string functions are intended to be called
<span class="lineNum">      80 </span>            :      * from a template function: &quot;... as_short_string(charT c='\0');&quot; */
<span class="lineNum">      81 </span>            :     const char* as_short_string(char) const
<span class="lineNum">      82 </span>            :     {
<span class="lineNum">      83 </span>            :       return as_short_string();
<span class="lineNum">      84 </span>            :     }
<span class="lineNum">      85 </span>            :     const char* as_long_string(char) const
<span class="lineNum">      86 </span>            :     {
<span class="lineNum">      87 </span>            :       return as_long_string();
<span class="lineNum">      88 </span>            :     }
<span class="lineNum">      89 </span>            : #ifndef BOOST_NO_STD_WSTRING
<span class="lineNum">      90 </span>            :     const wchar_t* as_short_string(wchar_t) const
<span class="lineNum">      91 </span>            :     {
<span class="lineNum">      92 </span>            :       return as_short_wstring();
<span class="lineNum">      93 </span>            :     }
<span class="lineNum">      94 </span>            :     const wchar_t* as_long_string(wchar_t) const
<span class="lineNum">      95 </span>            :     {
<span class="lineNum">      96 </span>            :       return as_long_wstring();
<span class="lineNum">      97 </span>            :     }
<span class="lineNum">      98 </span>            : #endif // BOOST_NO_STD_WSTRING
<span class="lineNum">      99 </span>            :   };
<span class="lineNum">     100 </span>            : 
<span class="lineNum">     101 </span>            : } } //namespace gregorian
<span class="lineNum">     102 </span>            : 
<span class="lineNum">     103 </span>            : 
<span class="lineNum">     104 </span>            : 
<span class="lineNum">     105 </span>            : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
